<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>流程控制和循环语句</title>
</head>
<body>

</body>
<script>
    // if语句
    let month = 3;
    if (month >= 3 && month <= 5){
        document.write("春")
    } else if (month >= 6 && month <= 8){
        document.write("夏")
    }else if (month >= 6 && month <= 8){
        document.write("秋")
    }else {
        document.write("冬")
    }
    document.write("<br>")

    // switch语句
    switch (month) {
        case 3:
        case 4:
        case 5:
            document.write("春");
            break;
        case 6:
        case 7:
        case 8:
            document.write("夏");
            break;
        case 9:
        case 10:
        case 11:
            document.write("秋");
            break;
        case 12:
        case 1:
        case 2:
            document.write("冬");
            break;
    }
    document.write("<br>")

    // for循环
    for (let i = 1; i <= 5; i++) {
        document.write(i + "<br>")
    }

    // while循环
    let n = 6;
    while (n <= 10){
        document.write(n + "<br>");
        n++;
    }

</script>
</html>